#include <vector>
#include "generaldef.h"
#include "problem.h"

using namespace std;

#ifndef DATACONF_H
#define DATACONF_H 1

class dataconf_t{
	private:
		char _findnext(FILE *&);
		FILE *_fdataconf;		// file pointer for data configuration.
		char _findbeside(FILE *&);
		bool _getcontent(FILE *&, char*, int, const char*, int, bool);
	public:
		vector<problem_container> problems;
		dataconf_t(){ problems.clear(); }
		bool getfile(const char *);
		bool getnextcase(const char *);		// will return -1 if reached the end, otherwise return case count.
		bool getnextprob(const char *);		// call before getting the first case, return true if successful.
		void finish(){ if(_fdataconf) fclose(_fdataconf); }
};

#endif
